@(qcms: List[Qcm]) 
@import helper._ 
@header()

@main("Qcm List") {
<fieldset>
	<div class="bs-docs-example" >
<legend> QCMs Cr&eacute;&eacute;s. Total : @qcms.size() qcm(s)</legend>  
<br/>
<p>Pour avoir le d&eacute;tail de chaque QCM cliquer sur la loupe.</p>
<br/> 
        <table class="table table-condensed">
            <thead>
            	<tr>
            		<th></th>
                    <th><h5>Libelle</h5></th>
                    <th><h5>Createur</h5></th>
                    <th><h5>Statut</h5></th>
                </tr>
            </thead>
            <tbody>

			@for(qcm <- qcms) {			
				<tr>
					<td width = 20>
						<div class="accordion-group">
							<div class="accordion-heading">
								<a href="#collapse@qcm.getIdQcm()"   data-parent="#accordion@qcm.getIdQcm()"  data-toggle="collapse" class="accordion-toggle">
								<i class="icon-search" size="small"/></i>
								</a> 
							</div>
						</div>
					</td> 
					
					<td><p class="text-info"> @qcm.getLibelle() </p></td>
					<td>@qcm.getUtilisateur().getNom()</td>
					@if(qcm.getEstPublie()){
						<td>Clos - Notes publiees </td>
					}else{
						@if(qcm.getStatut()=="Clos" && !qcm.getEstPublie()){
							<td><font color="red">Clos - A valider</font></td>
						}else{
							<td>@qcm.getStatut()</td>
						}
					}
				</tr>
				<tr> 
					<td colspan="5"> 
						<div class="accordion-body collapse" id="collapse@qcm.getIdQcm()" style="height: 0px;"> 
						 	<div class="accordion-inner" >
							
							<div class="controls controls-row">
							<div class="span4" >
						 	Creation : @qcm.getDateCreation().format("dd/MM/yyyy HH:mm")<br>
						 	Ouverture : @qcm.getDateOuverture().format("dd/MM/yyyy HH:mm")<br>
						 	Fermeture : @qcm.getDateCloture().format("dd/MM/yyyy HH:mm")<br>
						 	</div>
						 	<div class="span4" >
							Nombre de questions : @qcm.getListeQuestions().size()<br>
						 	Cle d'authentification : <b>@qcm.getCleAuthentification()</b><br>
						 	</div>
						 	<div class="span3" >
						 	@if(qcm.getStatut() == "Clos" || qcm.getStatut()== "Ouvert"){
						 		<div class="input-append">
									<a class="btn btn-primary" href="@routes.ConsulterQCM.detailQcmCree(qcm.getIdQcm())">Voir les resultats<i class="icon-white icon-circle-arrow-right"></i></a>
        						</div>
        					}
        					@if(qcm.getStatut() == "A venir"){
						 		<div class="input-append">
									<a class="btn btn-primary" href="@routes.ModifierQCM.modifierQCM(qcm.getIdQcm())">Modifier<i class="icon-white icon-circle-arrow-right"></i></a>
        						</div>
        					}
								
						 	</div>
						 	</div>
						 	
							 </div>
						</div>
					</td>
				</tr>
	}
	</tbody>
        </table>
        
   <a class="btn btn-primary" href="@routes.Application.redirectionAccueil("")">Menu principal <i class="icon-white icon-circle-arrow-right"></i></a>
</div>
</fieldset>
}
